package org.oschina.api.index.model;

import org.oschina.api.index.IndexType;
import org.oschina.bean.BaseBean;

public class IndexHandleBean extends BaseBean {

	private String path;
	private String where;
	private String fields[];
	private Object values[];
	private IndexType indexType;
	
	public IndexHandleBean()
	{
		
	}
	
	/**
	 * 创建用构造方法
	 * @param path
	 * @param fields
	 * @param values
	 */
	public IndexHandleBean(String path,String fields[],Object values[])
	{
		this.path=path;
		this.fields=fields;
		this.values=values;
		this.indexType=IndexType.CREATE;
	}
	
	/**
	 * 更新用构造方法
	 * @param path
	 * @param where
	 * @param fields
	 * @param values
	 */
	public IndexHandleBean(String path,String where,String fields[],Object values[])
	{
		this.path=path;
		this.where=where;
		this.fields=fields;
		this.values=values;
		this.indexType=IndexType.UPDATE;
	}
	
	/**
	 * 移除用构造方法
	 * @param path
	 * @param where
	 */
	public IndexHandleBean(String path,String where)
	{
		this.path=path;
		this.where=where;
		this.indexType=IndexType.REMOVE;
	}
	
	public String getWhere() {
		return where;
	}
	public IndexType getIndexType() {
		return indexType;
	}
	public void setWhere(String where) {
		this.where = where;
	}
	public void setIndexType(IndexType indexType) {
		this.indexType = indexType;
	}
	public String getPath() {
		return path;
	}
	public String[] getFields() {
		return fields;
	}
	public Object[] getValues() {
		return values;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public void setFields(String[] fields) {
		this.fields = fields;
	}
	public void setValues(Object[] values) {
		this.values = values;
	}
}